package com.xizi.string;

public class string {
    public static void main(String[] args) {
        String a0 = "xizi";
        String a1 = new String("xizi");
        String a2 = new String("xizi");
        System.out.println(a0 == a1);
        a1.intern(); //这里不起作用 返回值没有赋给a1
        a2 = a2.intern(); //这里把常量池中的 “xizi” 引用给a2
        System.out.println(a0 == a1);
        System.out.println(a0 == a1.intern());
        System.out.println(a0 == a2);

    }
}
